home *** CD-ROM | disk | FTP | other *** search
- #!/bin/csh -f
- #
- # $Id: edir,v 1.1 93/08/20 13:19:12 carlson Exp $
- #
- # Description:
- # This script will scan a directory and just list those files
- # that are executable.
- #
- # Revision History:
- # $Log: edir,v $
- # Revision 1.1 93/08/20 13:19:12 carlson
- # Initial revision
- #
- # Revision 1.1 1993/02/24 14:13:08 chris
- # Initial revision
- #
- #
- #-----------------------------------------------------------------------
-
- if ( ! -e ~/bin/strlen ) then
- echo "This script requires the program 'strlen' to run."
- exit
- endif
-
- set list = ()
- set i = 0
- foreach file ( * )
- if ( -d $file ) continue
- if ( -x $file ) then
- set list = ( $list $file )
- set a = `strlen $file`
- if ( $a > $i ) set i = $a
- endif
- end
-
- if ( $i == 0 ) exit
-
- #----
- # i = Maximum size of word
- # columns = Number of possible columns
- # rows = Number of rows necessary
- #
-
- @ i = $i + 2
- @ columns = 80 / $i
- @ rows = ( $#list / $columns ) + 1
- set format = "%-${i}.${i}s"
-
- @ row = 0
-
- while ( $rows > $row )
- @ column = 0
- while ( $columns > $column )
- @ element = ( $row * $columns ) + $column + 1
- if ( $element <= $#list ) then
- printf "$format" $list[$element]\*
- endif
- @ column = $column + 1
- end
- echo ""
- @ row = $row + 1
- end
-